package com.itheima.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

@Configuration
public class PasswordConfig {

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

    public static void main(String[] args) {
        String p1 = "123456";
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        String p2 = encoder.encode(p1);
        System.out.println("---->" + p2);
    }
//    $2a$10$f4BhZh8LKvLW7RjC6QCveueq9fVi//OD4Gt0y.N/WTZHr1JGA3KJu
//    $2a$10$4fxeM37cjLvmiWECSf1sQu/k8UZFwWvchCmxDjZHHRUL0F2HIDvay
//    $2a$10$TEfjdUIiMFQUFVjM4f.P4egHrt1Zd0RhuXp3fXtseJlGGVD8aXx1q
//    $2a$10$RBG11kpj6iOPFiPHmKVAS.F206tw54V7VLfIi/8XNJtuSpRRI3yrO
}
